package com.jinlia.show.modules.base.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.jinlia.show.common.core.entity.BaseEntity;
import com.jinlia.show.modules.base.config.DynamicSchemaConfig;
import com.jinlia.show.modules.base.constant.EnableStatusEnum;
import com.jinlia.show.modules.base.constant.i.IBaseEnum;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 商品表
 */
@Data
@TableName(value = "erp_goods", schema = DynamicSchemaConfig.schema_system, autoResultMap = true)
public class Goods extends BaseEntity {
    @TableId()
    private Long id;
    /**
     * 商品名
     */
    private String goodsName;

    /**
     * 简介
     */
    private String brief;
    /**
     * 商品类型
     */
    private Long goodsType;
    /**
     * 商品图片
     */
    private String goodsPics;
    private BigDecimal originPrice;
    /**
     * 基础价格
     */
    private BigDecimal price;

    /**
     * 商品重量,KG
     */
    private Double weight;
    /**
     * 商品启用状态
     */
    private Integer enableStatus;
    @TableField(exist = false)
    private String enableStatusName;
    /**
     * 销售模式
     * A:无库存禁止销售，B:无库存提醒销售,C不限库存销售
     */
    private String saleModel;
    /**
     * 库存量
     */
    private Integer stockNum;

    /**
     *
     * @param enableStatus
     */
    private String richText;
    public void setEnableStatus(Integer enableStatus) {
        this.enableStatus = enableStatus;
        this.enableStatusName = IBaseEnum.getLabelByValue(enableStatus, EnableStatusEnum.class);
    }
}
